@echo off
call conda activate NLU  || (
    echo Failed to activate Conda environment.
    echo Please check environment name and ensure Conda is initialized.
    pause
    exit /b 1
)

set WANDB_MODE=offline

rem 配置参数
set task_name=mrpc
set seed_list=2

echo Running with task: %task_name%
set CUBLAS_WORKSPACE_CONFIG=:16:8
set PYTHONHASHSEED=0

for %%s in (%seed_list%) do (
    echo.
    echo ========================================
    echo Running %task_name% with seed: %%s
    echo ========================================

    python ../examples/text-classification/run_glue.py ^
    --model_name_or_path ..\FacebookAI\roberta-base ^
    --task_name %task_name% ^
    --do_train ^
    --do_eval ^
    --max_seq_length 512 ^
    --per_device_train_batch_size 16 ^
    --learning_rate 4e-4 ^
    --num_train_epochs 30 ^
    --output_dir .\results_\%task_name%_seed_%%s\model ^
    --overwrite_output_dir ^
    --logging_steps 10 ^
    --logging_dir .\results_\%task_name%_seed_%%s\log ^
    --evaluation_strategy epoch ^
    --save_strategy epoch ^
    --warmup_ratio 0.06 ^
    --apply_lora ^
    --lora_r 8 ^
    --lora_alpha 16 ^
    --seed %%s ^
    --weight_decay 0.1 ^
    --use_sr_rank_allocation True ^
    --calib_batch_size 16 ^
    --lora_budget_rank 192

    echo.
    echo Completed seed %%s successfully
)

echo.
echo ========================================
echo All %task_name% experiments completed!
echo Total seeds processed: %seed_list%
echo ========================================
echo.
pause